<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@ include file="/includes/main.jsp"%>
<script type="text/javascript">

$(document).ready(function(){
		for(var i=0; i<${tripOrder.numberOfPassagers}; i++) {
			$('#passengerSpecialPrice_'+i).prepend("<option value='' selected>无</option>");
		}
	});
</script>
<h2 class="contentTitle"><hi:text key="编辑页面" parameterLanguageKeys="旅游订单"/></h2>
<form action="tripOrderSave.action?navTabId=tripOrderList&callbackType=closeCurrent&ajax=1" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
<div class="pageContent">
	<div class="pageFormContent" layoutH="97">
		<dl>
			<dt><hi:text key="开班日期" entity="TripOrder"/>：</dt><dd>${tripOrder.trip.trip_date}</dd>
		</dl>
		<dl>
			<dt><hi:text key="线路名称" entity="TripOrder"/>：</dt><dd>${tripOrder.trip.trip_model.trip_name}</dd>
		</dl>
		<dl>
			<dt><hi:text key="订单号" entity="TripOrder"/>：</dt><dd>${tripOrder.order_number}</dd>
		</dl>
		<dl>
			<dt><hi:text key="订单来源" entity="TripOrder"/>：</dt><dd><hi:select emu="orderType" name="tripOrder.order_type" isLabel="true"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="下单日期" entity="TripOrder"/>：</dt><dd><fmt:formatDate value="${tripOrder.order_date}" pattern="yyyy-MM-dd hh:mm"/></dd>				  	 
		</dl>
		<dl>
			<dt><hi:text key="下单人" entity="TripOrder"/>：</dt><dd>${tripOrder.customer.fullName}</dd>
		</dl>

		
		<div class="divider"></div>
		
		<dl>
			<dt><hi:text key="预订人数" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.numberOfPassagers" class="textInput required integer" value="${tripOrder.numberOfPassagers}" alt="<hi:text key="请输入整数"/>"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="订单金额" entity="TripOrder"/>：</dt><dd><input type="text" id="amount" name="tripOrder.amount" class="textInput float" readonly="readonly" value="${tripOrder.amount}"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="订单状态" entity="TripOrder"/>：</dt><dd><hi:select emu="orderStatus" name="tripOrder.order_status"/></dd>
		</dl>
		
		<div class="divider"></div>
		
		<dl>
			<dt><hi:text key="联系人" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.contact" class="textInput required" value="${tripOrder.contact}" maxlength="30"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="联系人证件号" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.contactId" class="textInput" value="${tripOrder.contactId}" maxlength="30"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="联系人手机" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.contactCellPhone" class="textInput required mobile" value="${tripOrder.contactCellPhone}" maxlength="30"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="联系人电话" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.contanctPhone" class="textInput phone" value="${tripOrder.contanctPhone}" maxlength="30"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="联系人邮箱" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.contactEmail" class="textInput email" value="${tripOrder.contactEmail}" maxlength="30"/></dd>
		</dl>
		<dl>
			<dt><hi:text key="联系人邮编" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.contactPostCode" class="textInput integer" value="${tripOrder.contactPostCode}" /></dd>
		</dl>
		<dl>
			<dt><hi:text key="联系人地址" entity="TripOrder"/>：</dt><dd><input type="text" name="tripOrder.contactAddress" class="textInput" value="${tripOrder.contactAddress}" maxlength="30"/></dd>
		</dl>
				<input type="hidden" name="tripOrder.id" value="${tripOrder.id}"/>
				<input type="hidden" name="tripOrder.creator.id" value="${tripOrder.creator.id}"/>
				<input type="hidden" name="tripOrder.version" value="${tripOrder.version}"/>

		<div class="divider"></div>
		
		<div class="tabs">
			<div class="tabsHeader">
				<div class="tabsHeaderContent">
					<ul>
						<li><a href="javascript:void(0)"><span><hi:text key="旅客"/></span></a></li>
					</ul>
				</div>
			</div>
			<div class="tabsContent" style="height:150px;">
				<div>
					<table class="list nowrap" width="100%" >
						<thead>
							<tr>
								<th class=" required" name="name" size="12" maxlength="30"><hi:text key="旅客名" entity="Passenger"/></th>
								<th class=" required integer" name="id_card" size="12"><hi:text key="证件号" entity="Passenger"/></th>
								<th name="type" enumName="passengerType" size="12"><hi:text key="旅客类型" entity="Passenger"/></th>
								<th class="" name="name" lookupName="specialPrice" lookupUrl="<hi:url>specialPriceLookup.action?lookup=1</hi:url>" suggestClass="org.hi.trip.model.SpecialPrice" searchFields="name" size="12"><hi:text key="特殊价格" entity="Passenger"/></th>
								<th type="del" width="60"><hi:text key="操作"/></th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="item" items="${tripOrder.passengers}"  varStatus="s">
							<tr>
							<input type="hidden" name="tripOrder.passengers[${s.index}].id" value="${item.id}"/>
							<input type="hidden" name="tripOrder.passengers[${s.index}].version" value="${item.version}"/>
								<td>
									<input type="text" class=" required" name="tripOrder.passengers[${s.index}].name" value="${item.name}" size="10" maxlength="30"/>
								</td>
								<td>
									<input type="text" class=" required integer" name="tripOrder.passengers[${s.index}].id_card" value="${item.id_card}" size="20" alt="<hi:text key="请输入证件号"/>"/>
								</td>
								<td>
									<hi:select emu="passengerType" name="tripOrder.passengers[${s.index}].type" />
								</td>
								<td><hi:entitySelect name="tripOrder.passengers[${s.index}].specialPrice.id" id="passengerSpecialPrice_${s.index}"  filterName="specialPriceFilter" onchange="javascript:countSpecialPrice()" entityName="org.hi.trip.model.SpecialPrice" key="id" title="name,price" pattern="," /></td>
								<td><a href="<hi:url>passengerRemove.action?ajax=1&passenger.id=${item.id}</hi:url>" class="btnDel" title="<hi:text key="确定要删除吗?"/>">删除</a></td>
							</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>								
				
			</div>
			<div class="tabsFooter">
				<div class="tabsFooterContent"></div>
			</div>
		</div>				
	</div>
	<div class="formBar">
		<ul>
			<li><div class="buttonActive"><div class="buttonContent"><button type="submit"><hi:text key="保存"/></button></div></div></li>
			<li><div class="button"><div class="buttonContent"><button class="close" type="button"><hi:text key="关闭"/></button></div></div></li>
		</ul>
	</div>  
</div>
</form>
